package com.ruoyi.web.wuliu.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.wuliu.mapper.TCorporationMapper;
import com.ruoyi.web.wuliu.domain.TCorporation;
import com.ruoyi.web.wuliu.service.ITCorporationService;

/**
 * 物流设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-20
 */
@Service
public class TCorporationServiceImpl implements ITCorporationService 
{
    @Autowired
    private TCorporationMapper tCorporationMapper;

    /**
     * 查询物流设备
     * 
     * @param id 物流设备主键
     * @return 物流设备
     */
    @Override
    public TCorporation selectTCorporationById(Integer id)
    {
        TCorporation tCorporation = tCorporationMapper.selectTCorporationById(id);
        tCorporation.setBrowseCount(tCorporation.getBrowseCount()+1);
        tCorporationMapper.updateTCorporation(tCorporation);
        return tCorporation;
    }

    /**
     * 查询物流设备列表
     * 
     * @param tCorporation 物流设备
     * @return 物流设备
     */
    @Override
    public List<TCorporation> selectTCorporationList(TCorporation tCorporation)
    {
        return tCorporationMapper.selectTCorporationList(tCorporation);
    }

    /**
     * 新增物流设备
     * 
     * @param tCorporation 物流设备
     * @return 结果
     */
    @Override
    public int insertTCorporation(TCorporation tCorporation)
    {
        tCorporation.setCreateTime(DateUtils.getNowDate());
        return tCorporationMapper.insertTCorporation(tCorporation);
    }

    /**
     * 修改物流设备
     * 
     * @param tCorporation 物流设备
     * @return 结果
     */
    @Override
    public int updateTCorporation(TCorporation tCorporation)
    {
        return tCorporationMapper.updateTCorporation(tCorporation);
    }

    /**
     * 批量删除物流设备
     * 
     * @param ids 需要删除的物流设备主键
     * @return 结果
     */
    @Override
    public int deleteTCorporationByIds(Integer[] ids)
    {
        return tCorporationMapper.deleteTCorporationByIds(ids);
    }

    /**
     * 删除物流设备信息
     * 
     * @param id 物流设备主键
     * @return 结果
     */
    @Override
    public int deleteTCorporationById(Integer id)
    {
        return tCorporationMapper.deleteTCorporationById(id);
    }
}
